package com.easy.project.domain.dto.system;

import com.easy.project.base.validate.EnumValidate;
import com.easy.project.constant.BooleanEnum;
import com.easy.project.constant.SexEnum;
import com.easy.project.constant.StatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;

/**
 * 用户新增/修改的dto
 *
 * @author wxz
 */
@Data
@ApiModel("UserEditDTO")
public class UserEditDTO {

    @ApiModelProperty("用户id 有则修改 无则新增")
    private Long id;

    @ApiModelProperty("用户登录名")
    @Length(min = 1, max = 50, message = "用户登录名长度超出范围")
    private String userName;

    @ApiModelProperty("用户姓名")
    @Length(min = 1, max = 50, message = "用户姓名长度超出范围")
    private String name;

    @ApiModelProperty("身份证号码")
    @Length(min = 1, max = 50, message = "身份证号码长度超出范围")
    private String idNumber;

    @ApiModelProperty("电话号码")
    @Length(min = 1, max = 50, message = "电话号码长度超出范围!")
    private String phoneNumber;

    @ApiModelProperty("邮箱")
    @Length(max = 50, message = "邮箱长度超出范围")
    private String mail;

    @ApiModelProperty("性别 0 女 1 男")
    @NotNull(message = "性别不能为空")
    @EnumValidate(baseEnum = SexEnum.class)
    private Integer sex;

    @ApiModelProperty("生日 格式：yyyy-MM-dd")
    private LocalDate birthday;

    @ApiModelProperty("状态 0 可用 1 不可用")
    @EnumValidate(baseEnum = StatusEnum.class)
    private Integer status;

}
